package com.lightsaber.trade.as.dao.reta;

import org.springframework.stereotype.Repository;
import org.springside.modules.orm.Page;

import com.lightsaber.trade.as.entity.reta.Order;
import com.lightsaber.trade.core.common.util.CurrentUser;
import com.lightsaber.trade.core.dao.BaseDao;

@Repository
public class OrderDao extends BaseDao<Order, String> {

    public void findPage(Order order, Page<Order> page) {

        eq("organization", CurrentUser.getOrg());

        if (order != null) {
            like("name", order.getName());
            like("customerName", order.getCustomerName());
        }

        findPage(page);
    }
}
